<?php


namespace App\Models;


use Illuminate\Database\Eloquent\SoftDeletes;

class ImUsers extends BaseModel
{
    use SoftDeletes;
    protected $table = 'users';
    protected $dateFormat = null;

    //最后一条登录信息
    public function lastLoginLog()
    {
        return $this->hasOne(ImUserLoginLogs::class, 'user_id', 'id')->orderBy('id', 'desc')->limit(1);
    }

    //用户余额
    public function balance()
    {
        return $this->hasOne(ImUserBalance::class, 'user_id', 'id');
    }
}
